package com.zjtaixue.o2o.util;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;

@Slf4j
public class RequestParamUtil {

    public static String readJSONString(HttpServletRequest request){
        StringBuffer json=new StringBuffer();
        String line=null;
        try{
            BufferedReader reader=request.getReader();
            while ((line=reader.readLine())!=null){
                json.append(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        log.info("[前端返回数据]={}",json.toString());
        return json.toString();
    }
}
